<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
        div{
            width: 300px;
            height: 400px;
            padding: 10px;
            background: red;
            border: 10px solid black;
        }
    </style>
</head>
<body>
    <div></div>
    <script type="text/javascript">
        var a = document.getElementsByTagName('div')[0];
        console.log(document.documentElement.clientHeight);
        console.log(a.clientLeft);
        for (var i = 0; i < 10; i++) {
            (function (i) {
                setTimeout(function () {
                    console.log(i);
                }, 1000)
            })(i)
        }
    </script>
</body>
</html>
